// 20210511  zaq  引入中文
// 20210513  zaq  引入样式
// 20210517  zaq  引入axios
// 20210519  zaq  引入moment、vuex
// 20210525  zaq  引入vue-moment
// 20210526  zaq  引入图表echarts

import { createApp } from 'vue'

import ElementPlus from 'element-plus';
// import 'element-plus/lib/theme-chalk/index.css';

import './theme/index.css';

import 'dayjs/locale/zh-cn'
import locale from 'element-plus/lib/locale/lang/zh-cn'

import App from './App.vue'
import router from './router'
import store from './store'

import axios, { AxiosInstance } from "axios";
import VueAxios from 'vue-axios'

import moment from 'moment';


import * as echarts from 'echarts'



const app = createApp(App);
// app.prototype.$axios=axios;
app.config.globalProperties.$http = axios;
app.config.globalProperties.$echarts = echarts;
app.use(store).use(moment).use(VueAxios, axios).use(router).use(ElementPlus, { locale }).mount('#app')


router.beforeEach((to, from, next) => {
    /* 路由发生变化修改页面title */
    if (to.meta.title) {
        document.title = to.meta.title
    }
    next()
})
